﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Pay.Data {
    public partial class LogisticsMap
        : System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<Logistics> {
        public LogisticsMap() {
            // table
            ToTable("mc_Logistics", "dbo");

            // keys
            HasKey(t => t.Id);

            // Properties
            Property(t => t.Id)
                .HasColumnName("Id")
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
                .IsRequired();
            Property(t => t.FlightNO)
                .HasColumnName("FlightNO")
                .HasMaxLength(50)
                .IsOptional();
            Property(t => t.LogisticsNO)
               .HasColumnName("LogisticsNO")
               .HasMaxLength(50)
               .IsOptional();
            Property(t => t.PostalNO)
              .HasColumnName("PostalNO")
              .HasMaxLength(50)
              .IsOptional();
            Property(t => t.PayId)
               .HasColumnName("PayId")
               .IsRequired();
            Property(t => t.LogisticsTime)
              .HasColumnName("LogisticsTime")
              .IsOptional();
            Property(t => t.LogisticsStatus)
              .HasColumnName("LogisticsStatus")
              .IsRequired();
            HasRequired(t => t.PayInfo)
              .WithMany()
              .HasForeignKey(d => d.PayId)
              .WillCascadeOnDelete(false);


        }
    }
}
